-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create initial api for CRUD actions on DB #3
Conversation
… between an ExerciseCategory and Exercise
…y exercises that use it
Created issue #4 to track the refactoring of this code and ideas. However I am happy for now with it as I just wanted to get a working version complete which I can then iterate on as I learn more about ASP.NET Core 1.0. Will close PR once I have had a chance to throughly test. |
@@ -0,0 +1,45 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be deleted - debugging in VSCode for ASP.NET Core 1.0 apps isn't supported yet and will be brought in by a plugin.
See microsoft/vscode#275 and https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/
[HttpPost] | ||
[Route("{id}")] | ||
public JsonResult Update(int id, [FromBody] ExerciseViewModel model) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null check for model
SummaryMostly just need to rename things to make the code clearer. Should also:
|
Tested locally and all works. |
Github Issue: #2
Created the api to handle CRUD actions on the DB using EF7. Not the most efficient solution; could use automapper for example to handle the conversion of model <---> view model, EF code is not efficient but works.